import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 节假日表分页查询
 * @param {查询条件} data
 */
export function listLayHoliday(query) {
  return request({
    url: 'business/LayHoliday/list',
    method: 'get',
    params: query,
  })
}

/**
 * 新增节假日表
 * @param data
 */
export function addLayHoliday(data) {
  return request({
    url: 'business/LayHoliday',
    method: 'post',
    data: data,
  })
}
/**
 * 修改节假日表
 * @param data
 */
export function updateLayHoliday(data) {
  return request({
    url: 'business/LayHoliday',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取节假日表详情
 * @param {Id}
 */
export function getLayHoliday(id) {
  return request({
    url: 'business/LayHoliday/' + id,
    method: 'get'
  })
}

/**
 * 删除节假日表
 * @param {主键} pid
 */
export function delLayHoliday(pid) {
  return request({
    url: 'business/LayHoliday/delete/' + pid,
    method: 'POST'
  })
}
// 导出节假日表
export async function exportLayHoliday(query) {
  await downFile('business/LayHoliday/export', { ...query })
}
